
<%@ page import="cm.NewsDao.NewsDao1" %>
<%@ page import="cm.NewsDaoImpl.NewsDaoImpl1" %><%--
  Created by IntelliJ IDEA.
  User: 31052
  Date: 2022/4/6
  Time: 12:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
        <%
                String newsid = request.getParameter("newsid");
                /*获取id*/
                if (newsid != null || newsid !=""){
                    int newId=Integer.parseInt(newsid);
                    NewsDao1 newsDao1 = new NewsDaoImpl1();

                    if ( newsDao1.delete(newId)){
                        /*重定向*/
                        response.sendRedirect(request.getContextPath()+"/index2.jsp");
                    }else {
        %>
                    <div>删除失败</div>
        <%
                    }
                }
        %>
</body>
</html>
